/**
 * 系统监控界面样式
 * 为ComfyUI顶栏的系统监控组件提供样式
 */

/* 系统监控容器 */
.system-monitor-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 5px 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    color: #ecf0f1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 400px;
    max-width: 600px;
}

/* 监控项目 */
.system-monitor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.system-monitor-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 标签 */
.monitor-label {
    font-size: 10px;
    font-weight: 600;
    color: #bdc3c7;
    margin-bottom: 2px;
    text-align: center;
    white-space: nowrap;
}

/* 百分比 */
.monitor-percentage {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 详细信息 */
.monitor-details {
    font-size: 9px;
    color: #95a5a6;
    text-align: center;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 进度条容器 */
.monitor-progress {
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

/* 进度条 */
.monitor-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background-color 0.3s ease;
    position: relative;
    min-width: 2px;
}

/* 进度条颜色状态 */
.monitor-progress-bar.normal {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

.monitor-progress-bar.warning {
    background: linear-gradient(90deg, #f39c12, #f1c40f);
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}

.monitor-progress-bar.critical {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
    animation: pulse 2s infinite;
}

/* 脉冲动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 特定类型样式 */
.system-monitor-memory {
    border-left: 3px solid #3498db;
}

.system-monitor-gpu {
    border-left: 3px solid #9b59b6;
}

.system-monitor-cpu {
    border-left: 3px solid #e67e22;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .system-monitor-container {
        flex-direction: column;
        gap: 8px;
        min-width: 200px;
        max-width: 300px;
    }
    
    .system-monitor-item {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
    }
    
    .monitor-label {
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .monitor-percentage {
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .monitor-details {
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .monitor-progress {
        width: 60px;
        height: 4px;
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    .system-monitor-container {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .system-monitor-item {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .system-monitor-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .system-monitor-container {
        border: 2px solid #ffffff;
        background: #000000;
    }
    
    .system-monitor-item {
        border: 1px solid #ffffff;
        background: #333333;
    }
    
    .monitor-label {
        color: #ffffff;
    }
    
    .monitor-percentage {
        color: #ffffff;
    }
    
    .monitor-details {
        color: #cccccc;
    }
}

/* 动画效果 */
.system-monitor-item {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载状态 */
.system-monitor-item.loading {
    opacity: 0.6;
}

.system-monitor-item.loading .monitor-progress-bar {
    background: linear-gradient(90deg, #95a5a6, #bdc3c7);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 错误状态 */
.system-monitor-item.error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.system-monitor-item.error .monitor-percentage {
    color: #e74c3c;
}

/* 工具提示 */
.system-monitor-item {
    position: relative;
}

.system-monitor-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.system-monitor-item:hover::after {
    opacity: 1;
} 